package com.qyer.search.storm.util;

import com.google.gson.annotations.Expose;

import java.io.Serializable;
import java.util.List;

/**
 * Created by tangzheng on 16/1/10.
 */
public class EntityInfo implements Serializable {
  private int lid;
  private String title;
  private int cid;
  private int ccid;
  private int supplierid;

  private long start_time;
  private long end_time;

  private List<SetOutPlace> set_out_place;
  private List<City> cities;
  private List<Country> countries;
  private List<Channel> channels;
  private List<Tag> tags;

  private String version;
  private String serialization;

  public EntityInfo() {
  }

  public EntityInfo(int lid, String title, int cid, int ccid, List<City> cities,
                    List<Country> countries, List<Channel> channels){
    this.lid = lid;
    this.cid = cid;
    this.ccid = ccid;
    this.title = title;
    this.cities = cities;
    this.countries = countries;
    this.channels = channels;
  }

  public EntityInfo(int lid, String title, int cid, int ccid, int supplierid, long travel_starttime,
                    long travel_endtime, List<SetOutPlace> set_out_place, List<City> cities,
                    List<Country> countries, List<Channel> channels) {
    this.lid = lid;
    this.title = title;
    this.cid = cid;
    this.ccid = ccid;
    this.supplierid = supplierid;
    this.start_time = travel_starttime;
    this.end_time = travel_endtime;
    this.set_out_place = set_out_place;
    this.cities = cities;
    this.countries = countries;
    this.channels = channels;
  }

  public List<Tag> getTags() {
    return tags;
  }

  public void setTags(List<Tag> tags) {
    this.tags = tags;
  }

  public List<Channel> getChannels() {
    return channels;
  }

  public void setChannels(List<Channel> channels) {
    this.channels = channels;
  }

  public List<Country> getCountries() {
    return countries;
  }

  public void setCountries(List<Country> countries) {
    this.countries = countries;
  }

  public List<City> getCities() {
    return cities;
  }

  public void setCities(List<City> cities) {
    this.cities = cities;
  }

  public int getCcid() {
    return ccid;
  }

  public void setCcid(int ccid) {
    this.ccid = ccid;
  }

  public int getCid() {
    return cid;
  }

  public void setCid(int cid) {
    this.cid = cid;
  }

  public String getTitle() {
    return title;
  }

  public void setTitle(String title) {
    this.title = title;
  }

  public int getLid() {
    return lid;
  }

  public void setLid(int lid) {
    this.lid = lid;
  }

  public int getSupplierid() {
    return supplierid;
  }

  public void setSupplierid(int supplierid) {
    this.supplierid = supplierid;
  }

  public long getTravel_starttime() {
    return start_time;
  }

  public void setTravel_starttime(long travel_starttime) {
    this.start_time = travel_starttime;
  }

  public long getTravel_endtime() {
    return end_time;
  }

  public void setTravel_endtime(long travel_endtime) {
    this.end_time = travel_endtime;
  }

  public List<SetOutPlace> getSet_out_place() {
    return set_out_place;
  }

  public void setSet_out_place(List<SetOutPlace> set_out_place) {
    this.set_out_place = set_out_place;
  }

  public long getStart_time() {
    return start_time;
  }

  public void setStart_time(long start_time) {
    this.start_time = start_time;
  }

  public long getEnd_time() {
    return end_time;
  }

  public void setEnd_time(long end_time) {
    this.end_time = end_time;
  }

  public String getVersion() {
    return version;
  }

  public void setVersion(String version) {
    this.version = version;
  }

  public String getSerialization() {
    return serialization;
  }

  public void setSerialization(String serialization) {
    this.serialization = serialization;
  }

  public void setSerialization() {

  }

  @Override public boolean equals(Object o) {
    if (this == o)
      return true;
    if (o == null || getClass() != o.getClass())
      return false;

    EntityInfo that = (EntityInfo) o;

    if (lid != that.lid)
      return false;
    if (cid != that.cid)
      return false;
    if (ccid != that.ccid)
      return false;
    if (supplierid != that.supplierid)
      return false;
    if (start_time != that.start_time)
      return false;
    if (end_time != that.end_time)
      return false;
    if (!title.equals(that.title))
      return false;
    if (!set_out_place.equals(that.set_out_place))
      return false;
    if (!cities.equals(that.cities))
      return false;
    if (!countries.equals(that.countries))
      return false;
    if (!channels.equals(that.channels))
      return false;
    if (!tags.equals(that.tags))
      return false;
    if (!version.equals(that.version))
      return false;
    return serialization.equals(that.serialization);

  }

  @Override public int hashCode() {
    int result = lid;
    result = 31 * result + title.hashCode();
    result = 31 * result + cid;
    result = 31 * result + ccid;
    result = 31 * result + supplierid;
    result = 31 * result + (int) (start_time ^ (start_time >>> 32));
    result = 31 * result + (int) (end_time ^ (end_time >>> 32));
    result = 31 * result + set_out_place.hashCode();
    result = 31 * result + cities.hashCode();
    result = 31 * result + countries.hashCode();
    result = 31 * result + channels.hashCode();
    result = 31 * result + tags.hashCode();
    result = 31 * result + version.hashCode();
    result = 31 * result + serialization.hashCode();
    return result;
  }

  @Override public String toString() {
    return "EntityInfo{" +
      "lid=" + lid +
      ", title='" + title + '\'' +
      ", cid=" + cid +
      ", ccid=" + ccid +
      ", supplierid=" + supplierid +
      ", start_time=" + start_time +
      ", end_time=" + end_time +
      ", set_out_place=" + set_out_place +
      ", cities=" + cities +
      ", countries=" + countries +
      ", channels=" + channels +
      ", tags=" + tags +
      ", version='" + version + '\'' +
      ", serialization='" + serialization + '\'' +
      '}';
  }

}
